#ifndef PWM_API_H
#define PWM_API_H

#include <stdint.h>
#include "PinName.h"
#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    WGM_NORMAL_TOP_0XFF                 =0,
    WGM_PWM_PHASE_CORRECT_TOP_0XFF      =1,
    WGM_CTC_TOP_OCRA                    =2,
    WGM_FAST_PWM_TOP_0XFF               =3,
    WGM_MODE_4_RESERVED                 =4,
    WGM_PWM_PHASE_CORRECT_TOP_OCRA      =5,
    WGM_MODE_6_RESERVED                 =6,
    WGM_FAST_PWM_TOP_OCRA               =7
}WaveformGenerationMode;

/* custom mode: adjust_frequenc */
void pwm_adjust_any_freq(uint8_t _timer_nx,uint32_t freq,float value);
/* custom mode: adjust_duty_cycle */
void pwm_adjust_any_freq_duty_cycle(uint8_t _timer_nx,float duty_cycle); 


/* fixed mode: pwm_adjust_frequency */
void pwm_adjust_frequency_32khz(uint8_t _timer_nx,float duty_cycle);
void pwm_adjust_frequency_4khz(uint8_t _timer_nx,float duty_cycle);
void pwm_adjust_frequency_500hz(uint8_t _timer_nx,float duty_cycle);
void pwm_adjust_frequency_125hz(uint8_t _timer_nx,float duty_cycle);
void pwm_adjust_frequency_31hz(uint8_t _timer_nx,float duty_cycle);
/* fixed mode: pwm_adjust_frequency */
void pwm_adjust_32khz_duty_cycle(uint8_t _timer_nx,float duty_cycle);
void pwm_adjust_4khz_duty_cycle(uint8_t _timer_nx,float duty_cycle);
void pwm_adjust_500hz_duty_cycle(uint8_t _timer_nx,float duty_cycle);
void pwm_adjust_125hz_duty_cycle(uint8_t _timer_nx,float duty_cycle);
void pwm_adjust_31hz_duty_cycle(uint8_t _timer_nx,float duty_cycle);
#ifdef __cplusplus
}
#endif

#endif//end pwm api